/*

*** This do file creates the replication results for 

Trade Openness, Foreign Direct Investment and Child Labor (with Indra De Soysa), World Development, 33 (1),  2005, pp. 43-63

Eric Neumayer (LSE)																			

Please report any errors to e.neumayer@lse.ac.uk

*/

use "Article for World Development (child labor).dta", replace

* table 1
quietly reg clall  lnppppc1995 lnppppc1995sq  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
su labour1014rate clall primarynonenrol9099  secondarynonenrol9099  lnppppc1995   agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099  education health sachs tradefreefraser if e(sample)
corr labour1014rate clall primarynonenrol9099  secondarynonenrol9099  lnppppc1995   agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099  education health sachs tradefreefraser if e(sample)
corr labour1014rate clall primarynonenrol9099  secondarynonenrol9099  if e(sample)

* table 2
reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 eeandcasia latin ssa mena eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus

* table 3
nbreg clall  lnppppc1995 lnppppc1995sq  lnppp1995 agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
nbreg clall  lnppppc1995 lnppppc1995sq lnppp1995 agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus
reg primarynonenrol9099 lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
reg primarynonenrol9099 lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus
reg secondarynonenrol9099  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
reg secondarynonenrol9099 lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus

* table 4
reg labour1014rate  lnppppc1995  agricult199095 urban1995 sachswarner fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 sachswarner fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 tradefreefraser fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 tradefreefraser fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1, robus

* table 5
reg labour1014rate  lnppppc1995  agricult199095 urban1995 sachswarneropen fdistockpergdp1995 eeandcasia latin ssa mena  eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 sachswarneropen fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena  eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 tradefreefraser95 fdistockpergdp1995 eeandcasia latin ssa mena  eastasia if developing==1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 tradefreefraser95 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena  eastasia if developing==1, robus



* table 6
preserve
quietly  xi: fit labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1,
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list country dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list country dfits if dfits~=. & excl1==1

reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1 & excl1!=1, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1 & excl1!=1, robus
restore

reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 eeandcasia latin ssa mena eastasia if developing==1 & eeandcasia==0, robus
reg labour1014rate  lnppppc1995  agricult199095 urban1995 trade199095 fdistockpergdp1995 grade5success pupilteacherratio9099 health education eeandcasia latin ssa mena eastasia if developing==1 & eeandcasia==0, robus
